#ifndef __DEBUG_H__
#define __DEBUG_H__
#ifdef __cplusplus
extern "C" {
#endif

 

#define DEFAULT_HANDLE 0x100;

#include <rt_sys.h>
#include "gd32f4xx_libopt.h"
#include "stdio.h"




FILEHANDLE _sys_open(const char * name, int openmode);
int _sys_close(FILEHANDLE fh);

int _sys_read(FILEHANDLE fh, unsigned char * buf,
            unsigned len, int mode);

int _sys_write(FILEHANDLE fh, const unsigned char * buf,
            unsigned len, int mode);

int _sys_istty(FILEHANDLE fh);

int _sys_seek(FILEHANDLE fh, long pos);

int _sys_ensure(FILEHANDLE fh);

long _sys_flen(FILEHANDLE fh);

int _sys_tmpnam(char * name, int sig, unsigned maxlen);

void _sys_exit(int returncode);


#ifdef __cplusplus

}
#endif

#endif
